package com.qianyu.project.mapper.provider;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianyu.project.entity.ProviderInfo;
import org.apache.ibatis.jdbc.SQL;
import org.springframework.util.ObjectUtils;

import java.util.Map;

/**
 * author wyh
 * Date 2021/2/3
 **/
public class EmpProvider {
    public String WyhCreatedList(IPage<ProviderInfo> page, Map<String, String> params){
        return new SQL(){
            {
                SELECT("e.*,d.dept_name,p.post_name");
                FROM("emp e,dept d,post p");
                WHERE("e.dept_id=d.id and e.post_id=p.id");
                if(!ObjectUtils.isEmpty(params.get("Name"))){
                    WHERE("e.name like '%"+params.get("Name")+"%'");
                }
            }
        }.toString();
    }
}
